package cn.secby.pay.domain;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.*;
import cn.secby.common.core.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import cn.secby.common.core.web.domain.BaseEntity;

/**
 * 退款记录对象 tb_refund_record
 * @author shenkunlin
 * @date 2025-05-08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "tb_refund_record")
public class RefundRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value ="id" ,type = IdType.ASSIGN_ID )
    @JsonSerialize(using=ToStringSerializer.class)
    private Long id;

    /** 交易系统订单号【对于三方来说：商户订单】 */
    @Excel(name = "交易系统订单号【对于三方来说：商户订单】")
    @TableField(value = "trading_order_no")
    private Long tradingOrderNo;

    /** 业务系统应用标识 */
    @Excel(name = "业务系统应用标识")
    @TableField(value = "product_app_id")
    private String productAppId;

    /** 业务系统订单号 */
    @Excel(name = "业务系统订单号")
    @TableField(value = "product_order_no")
    private Long productOrderNo;

    /** 本次退款订单号 */
    @Excel(name = "本次退款订单号")
    @TableField(value = "refund_no")
    private Long refundNo;

    /** 第三方支付的退款单号 */
    @Excel(name = "第三方支付的退款单号")
    @TableField(value = "refund_id")
    private String refundId;

    /** 商户号 */
    @Excel(name = "商户号")
    @TableField(value = "enterprise_id")
    private Long enterpriseId;

    /** 退款渠道【支付宝、微信、现金】 */
    @Excel(name = "退款渠道【支付宝、微信、现金】")
    @TableField(value = "trading_channel")
    private String tradingChannel;

    /** 退款状态：1-退款中，2-成功, 3-失败 */
    @Excel(name = "退款状态：1-退款中，2-成功, 3-失败")
    @TableField(value = "refund_status")
    private Integer refundStatus;

    /** 返回编码 */
    @Excel(name = "返回编码")
    @TableField(value = "refund_code")
    private String refundCode;

    /** 返回信息 */
    @Excel(name = "返回信息")
    @TableField(value = "refund_msg")
    private String refundMsg;

    /** 备注【订单门店，桌台信息】 */
    @Excel(name = "备注【订单门店，桌台信息】")
    @TableField(value = "memo")
    private String memo;

    /** 本次退款金额 */
    @Excel(name = "本次退款金额")
    @TableField(value = "refund_amount")
    private BigDecimal refundAmount;

    /** 原订单金额 */
    @Excel(name = "原订单金额")
    @TableField(value = "total")
    private BigDecimal total;

    /** 是否删除  1 未删除  2 已删除 */
    @Excel(name = "是否删除  1 未删除  2 已删除")
    @TableField(value = "is_delete")
    @TableLogic(value = "1", delval = "2")
    private Integer isDelete;

}
